<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="收货单打印" />
<%@ include file="../inc/PrintTitle.jsp"%>
<head>
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	function doPrint(){
		ShowConfirm('确认框','确定开始打印吗？',340,80,"doPrintCallBack()");
	}
	function doPrintCallBack(){
		if(popRetVal!=null){
			document.getElementById("noPrinSpan").style.display="none";
			printContent("管理易-外协收货单","${enterpriseInfo.doPrint}","${enterpriseInfo.printWidth}");
			document.getElementById("noPrinSpan").style.display="";
		}
	}
	function doCancel(){
		window.close();
	}
	function showTotalDiv(cost,divId){
		var str="";
		str=str+"合计(大写)：";
		str=str+getBigMoney(""+cost);
		str=str+"<b>￥</b>"+cost+"&nbsp;";
		document.getElementById(divId).innerHTML=str;
	}
</script>
</head>
<body style="background-color:#FFFFFF">
<table width="100%" border="0"  align="center" cellpadding="0" cellspacing="0">
	<tr>
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td width="16%" rowspan="2"><img src="${enterpriseInfo.loginImage}" /></td>
					<td width="68%" height="40px" align="center" class="FontLarge_Bold">${licenseInfo.enterpriseName} 外协收货单</td>
					<td width="16%">&nbsp;</td>
				</tr>
				<tr>
				  <td colspan="2" align="right" valign="bottom" class="FontSmall"><div align="right">NO.&nbsp;${record.gatherBill.billCode}</td>
			  	</tr>
		  </table>
		</td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="ListTable">
				<tr class="ListTrPrint">
			      	<td class="FontSmall" width="70%">外协单位：${record.cooperatorName}</td>
			      	<td class="FontSmall" width="30%" align="right">收货日期：<fmt:formatDate value="${record.gatherBill.gatherDate}" pattern="yyyy-MM-dd"/></td>
				</tr>
				<tr class="ListTrPrint">
			      	<td class="FontSmall">备注：${record.gatherBill.mark}</td>
			      	<td class="FontSmall" align="right">外协单号：${record.cbCode}</td>
				</tr>
		  </table>
		</td>
	</tr>
	<tr>
		<td height="3"></td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" class="small_border">
				<tr class="ListTrPrint">
					<td width="10%" class="FontSmall_Bold" align="center">项目类型</td>
					<td width="16%" class="FontSmall_Bold" align="center">内容</td>
					<td width="12%" class="FontSmall_Bold" align="center">材质</td>
					<td width="19%" class="FontSmall_Bold" align="center">规格</td>
					<td width="10%" class="FontSmall_Bold" align="center">本次收货</td>
					<td width="7%" class="FontSmall_Bold" align="center">单位</td>
					<td width="7%" class="FontSmall_Bold" align="center">单价</td>
					<td width="8%" class="FontSmall_Bold" align="center">金额</td>
					<td width="11%" class="FontSmall_Bold" align="center">制作要求</td>
				</tr>
				<c:forEach var="item" items="${record.items}" varStatus="i">
				<tr class="ListTrPrint">
					<td class="FontSmall" align="center">${item.makeTypeName}</td>
					<td class="FontSmall" align="center">${item.finishedContent}</td>
					<td class="FontSmall" align="center">${item.productName}</td>
					<td class="FontSmall" align="center">
						<commonTag:parseEnterToBr source="${item.specification}" />
					  	<c:if test="${item.priceType=='AREA' || item.priceType=='LENGTH'}"> x <commonTag:parseBigDecimal source="${item.gatherBillItem.amount}" /></c:if>
					</td>
				  	<td class="FontSmall"><div align="center">${item.amountStr}</div></td>
					<td class="FontSmall"><div align="center">${item.unit}</div></td>
				  	<td class="FontSmall"><div align="center"><commonTag:parseBigDecimal source="${item.unitPrice}" /></div></td>
				  	<td class="FontSmall"><div align="center"><commonTag:parseBigDecimal source="${item.cost}" /></div></td>
				  	<td class="FontSmall"><div align="center"><commonTag:parseEnterToBr source="${item.makeRequire}" /></div></td>
				</tr>
				</c:forEach>
				<tr  class="ListTrPrint">
					<td class="FontSmall" colspan="9" >
						<div align="right" id="totalDiv">&nbsp;</div>
					</td>			  	
				</tr>
		  </table>
		</td>
	</tr>
	<tr>
		<td height="3"></td>
	</tr>
	<tr>
		<td>
			<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center" class="ListTable">
				<tr class="ListTrPrint">
					<td class="FontSmall" width="33%">开单人：${record.gatherBill.createrName}</td>
					<td class="FontSmall" width="33%">业务员：${record.managerName}</td>
					<td class="FontSmall" width="34%">送货人签名：</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td height="3"></td>
	</tr>	
	<c:if test="${codeRule.printFoot!=null && codeRule.printFoot!=''}">
	<tr>
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td class="FontSmall"><commonTag:parseEnterToBr source="${codeRule.printFoot}" /></td>
				</tr>
			</table>
		</td>
	</tr>
	</c:if>
	<tr id="noPrinSpan">
		<td>
			<table width="98%" border="0" cellspacing="1" cellpadding="1" align="center">
				<tr>
					<td>
						<input type="button" id="printButton" class="Button" value=" 开始打印" onClick="doPrint();">
						<input type="button" id="cancelButton" class="Button" value=" 退 出 " onClick="doCancel();">
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</body>
</html>
<script language="javascript">
	showTotalDiv(${record.cost},'totalDiv');
</script>